<%--
  Created by IntelliJ IDEA.
  User: 13699
  Date: 2021/9/4
  Time: 10:18
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page language="java" contentType="text/html; charset=utf-8"
         pageEncoding="utf-8" isELIgnored="false" %>
<link rel="stylesheet" href="/static/css/bootstrap.css"  media="all">
<link rel="stylesheet" href="/static/css/layui.css"  media="all">
<link rel="stylesheet" href="/static/css/MyStyle.css"  media="all">

<html>
<head>
    <title>Title</title>
</head>
<body>
<form action="/user/addUser" class="layui-form formMargin" method="post">
    <div><h1>添加信息</h1></div>
    <div class="layui-form-item">
        <div class="layui-input-inline">
            <label class="formLabel">user</label>
            <input type="text" name="name" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item" >
        <div class="layui-input-inline">
            <label class="formLabel">password</label>
            <input type="text" name="password" class="layui-input">
        </div>
    </div>
    <div>
        <div class="layui-form-radio">
            <label>男</label>
            <input type="radio" name="sex" value="男">
            <label>女</label>
            <input type="radio" name="sex" value="女">
        </div>
    </div>
    <div class="layui-form-item" >
        <div class="layui-input-inline">
            <label class="formLabel">生日</label>
            <input type="date" name="birthday" class="layui-input" value="" >
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-inline">
            <label class="formLabel">注册日</label>
            <input type="date" name="registTime" class="layui-input">
        </div>
    </div>
    <div >
        <input type="submit" name="btn" value="新增" class="layui-btn layui-btn-warm">
    </div>
</form>
</body>
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script src="/static/layui.js" charset="utf-8"></script>
<script src="static/js/bootstrap.js"></script>
<script>
    function add() {

        var name = $('input[name=name]').val();
        var password = $('input[name=password]').val();
        if ($("input[name=sex]:checked")) {
            sex = $("input[name=sex]:checked").attr("checked", true).val();
        } else {
            sex = $("input[name=sex]:checked").attr("checked", false).val();
        }
        var birthday = $('input[name=birthday]').val();
        var registTime = $('input[name=registTime]').val();
        url = '/user/addUser?name=' + name + '&password=' + password + '&sex=' + sex + '&birthday=' + birthday + '&registTime=' + registTime;

        location.href = url;


    }
</script>

</html>
